package com.nkzy.mapper;

import com.nkzy.domain.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface UserMapper {
    //查询所有的用户
    @Select("select * from user")
    List<User> findAll();
    //查询一个用户
    @Select("select * from user where id=#{id}")
    User findById(Integer id);
    //更新
    @Update("update user set username=#{username},password=#{password},email=#{email} where id=#{id}")
    void updateUser(User user);
    //删除
    @Delete("delete from user where id=#{id}")
    void deleteUser(Integer id);
    @Insert("insert into ssm (id,username,password,email) values(#{id},#{username},#{password},#{email})")
    void InsertUser();

}
